//
//  BLNewTableViewController.m
//  百思不得姐
//
//  Created by hbl on 16/3/14.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLNewTableViewController.h"
#import "BLSubscribeViewController.h"

@interface BLNewTableViewController ()

@end

@implementation BLNewTableViewController

- (NSString *)nearTopic
{
    return @"newlist";
}

- (void)viewDidLoad {
    self.nearTopic = @"newlist";
    [super viewDidLoad];
    [self setupNav];
   self.view.backgroundColor = BLBg;
}

- (void)setupNav
{
    self.navigationItem.titleView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MainTitle"]];
    UIButton *leftBtn = [self setItemButtonWithImage:@"MainTagSubIcon" selImage:@"MainTagSubIconClick"];
    [leftBtn addTarget:self action:@selector(leftBtnOnClick) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:leftBtn];
}

- (UIButton *)setItemButtonWithImage:(NSString *)image selImage:(NSString *)selImage
{
    UIButton *btn = [[UIButton alloc]init];
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:selImage] forState:UIControlStateHighlighted];
    btn.bounds = CGRectMake(0, 0, btn.currentBackgroundImage.size.width, btn.currentBackgroundImage.size.height);
    
    return btn;
}

- (void)leftBtnOnClick
{
    BLSubscribeViewController *sub = [[BLSubscribeViewController alloc]init];
    [self.navigationController pushViewController:sub animated:YES];
}

@end
